package com.flyco.modules.stm.entity;

import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import com.flyco.poi.excel.annotation.Excel;

/**
 * @Description: 业务和出入库关联表
 * @Author: flyco
 * @Date:   2022-11-29
 * @Version: V1.0
 */
@Data
@TableName("stm_retreat_item")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="stm_retreat_item对象", description="业务和出入库关联表")
public class StmRetreatItem {
    
	/**id*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
	private Long id;
	/**退仓单id*/
	@Excel(name = "退仓单id", width = 15)
    @ApiModelProperty(value = "退仓单id")
	private Long retreatId;
	/**商品id*/
	@Excel(name = "商品id", width = 15)
    @ApiModelProperty(value = "商品id")
	private Long productId;
	/**商品货号*/
	@Excel(name = "商品货号", width = 15)
    @ApiModelProperty(value = "商品货号")
	private String productSn;
	/**商品名称*/
	@Excel(name = "商品名称", width = 15)
    @ApiModelProperty(value = "商品名称")
	private String productName;
	/**退货数量*/
	@Excel(name = "退货数量", width = 15)
    @ApiModelProperty(value = "退货数量")
	private Integer productQty;
	/**发货数量*/
	@Excel(name = "发货数量", width = 15)
    @ApiModelProperty(value = "发货数量")
	private Integer sendQty;
	/**库存类型 STOCK_TYPE_GOODS:商品库存; STOCK_TYPE_GIFT:赠品库存*/
	@Excel(name = "库存类型 STOCK_TYPE_GOODS:商品库存; STOCK_TYPE_GIFT:赠品库存", width = 15)
    @ApiModelProperty(value = "库存类型 STOCK_TYPE_GOODS:商品库存; STOCK_TYPE_GIFT:赠品库存")
	private String stockType;
	/**创建人*/
	@Excel(name = "创建人", width = 15)
    @ApiModelProperty(value = "创建人")
	private String createBy;
	/**创建时间*/
	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
	private Date createTime;
	/**更新人*/
	@Excel(name = "更新人", width = 15)
    @ApiModelProperty(value = "更新人")
	private String updateBy;
	/**更新时间*/
	@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
	private Date updateTime;

	@TableField(exist = false)
	private String stockType_dictText;

	public void setStockTypeDictText() {
		switch (stockType){
			case "STOCK_TYPE_GOODS":
				stockType_dictText = "商品";
				return;
			case "STOCK_TYPE_GIFT":
				stockType_dictText = "赠品";
				return;
			case "STOCK_TYPE_SAMPLE":
				stockType_dictText = "样品";
				return;
			default:
				stockType_dictText = "未知"+stockType;
		}
	}
}
